<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title></title>
<meta name="Generator" content="Cocoa HTML Writer">
<meta name="CocoaVersion" content="949.27">
<style type="text/css">
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 14.0px Helvetica}
p.p4 {margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 9.0px Monaco; min-height: 12.0px}
p.p5 {margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 12.0px Helvetica}
p.p6 {margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 12.0px Helvetica; min-height: 14.0px}
p.p7 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco}
p.p8 {margin: 0.0px 0.0px 0.0px 85.0px; text-indent: -85.0px; font: 12.0px Helvetica; min-height: 14.0px}
p.p9 {margin: 0.0px 0.0px 0.0px 85.0px; text-indent: -85.0px; font: 12.0px Helvetica}
p.p10 {margin: 0.0px 0.0px 0.0px 57.0px; text-indent: -57.0px; font: 14.0px Helvetica}
span.s1 {font: 18.0px Helvetica}
span.s2 {color: #0013bc}
span.s3 {color: #606060}
span.s4 {font: 12.0px Helvetica}
span.Apple-tab-span {white-space:pre}
</style>
</head>
<body>
<p class="p1"><span class="s1"><b>PVFile<span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></b></span><b>reads and prepares data from CSounds pvanal program</b></p>
<p class="p2"><br></p>
<p class="p1"><b>Inherits from: Object : AbstractFunction : Stream : IOStream : UnixFILE : File</b></p>
<p class="p2"><br></p>
<p class="p1"><b>See also:</b> PVSynth, PVInfo</p>
<p class="p2"><br></p>
<p class="p3"><b>Some Important Issues Regarding PVFile</b></p>
<p class="p2"><br></p>
<p class="p1">This currently only works with .pv files. .pvx and CSound 5 files will be implemented soon.</p>
<p class="p2"><br></p>
<p class="p3"><b>Creation / Class Methods</b></p>
<p class="p4"><br></p>
<p class="p5"><b><span class="Apple-tab-span">	</span>*new (path, server)</b></p>
<p class="p6"><br></p>
<p class="p7"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>a = <span class="s2">PVFile</span>.new(<span class="s3">"sounds/cl-c4.pv"</span>, s);<span class="s4"><b><span class="Apple-tab-span">	</span></b></span></p>
<p class="p8"><br></p>
<p class="p9"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><b>path </b>- path to a CSound pv file</p>
<p class="p9"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><b>server </b>- The server that data will be loaded on to. Defaults to Server.default</p>
<p class="p6"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></p>
<p class="p4"><br></p>
<p class="p5"><b><span class="Apple-tab-span">	</span>*load (path, server)</b></p>
<p class="p6"><b><span class="Apple-tab-span">	</span></b></p>
<p class="p5"><b><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></b>Read and load directly to the server.</p>
<p class="p4"><br></p>
<p class="p10"><b>Accessing Instance and Class Variables</b></p>
<p class="p6"><span class="Apple-tab-span">	</span></p>
<p class="p5"><b><span class="Apple-tab-span">	</span>minFreq</b></p>
<p class="p6"><b><span class="Apple-tab-span">	</span></b><span class="Apple-tab-span">	</span></p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>From the header, the lowest freq analyzed.</p>
<p class="p6"><br></p>
<p class="p5"><b><span class="Apple-tab-span">	</span>maxFreq</b></p>
<p class="p6"><br></p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>From the header, the highest freq analyzed.</p>
<p class="p6"><br></p>
<p class="p6"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></p>
<p class="p5"><b><span class="Apple-tab-span">	</span>sndDur</b></p>
<p class="p6"><b><span class="Apple-tab-span">	</span></b><span class="Apple-tab-span">	</span></p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>The duration of the sound file analyzed</p>
<p class="p6"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></p>
<p class="p5"><b><span class="Apple-tab-span">	</span>header</b></p>
<p class="p6"><b><span class="Apple-tab-span">	</span></b><span class="Apple-tab-span">	</span></p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>Returns the pv file's header. (well... most of it).</p>
<p class="p6"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></p>
<p class="p5"><b><span class="Apple-tab-span">	</span>nFrames</b></p>
<p class="p6"><b><span class="Apple-tab-span">	</span></b><span class="Apple-tab-span">	</span></p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>The number of frames in the analysis</p>
<p class="p6"><br></p>
<p class="p5"><b><span class="Apple-tab-span">	</span>nBins</b></p>
<p class="p6"><b><span class="Apple-tab-span">	</span></b><span class="Apple-tab-span">	</span></p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>The number of bins in the analysis</p>
<p class="p6"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></p>
<p class="p5"><b><span class="Apple-tab-span">	</span>buffer</b></p>
<p class="p6"><b><span class="Apple-tab-span">	</span></b><span class="Apple-tab-span">	</span></p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>The buffer number where PVFile stores data to a server</p>
<p class="p5"><b><span class="Apple-tab-span">	</span>data</b></p>
<p class="p6"><b><span class="Apple-tab-span">	</span></b><span class="Apple-tab-span">	</span></p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>An array showing the data form the pv file</p>
<p class="p6"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></p>
<p class="p4"><br></p>
<p class="p5"><b><span class="Apple-tab-span">	</span>saveForSC (path)</b></p>
<p class="p6"><b><span class="Apple-tab-span">	</span></b></p>
<p class="p5"><b><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>To use NRT - you must re-write the data file out as a sound file!</b></p>
<p class="p9"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><b>path </b>- The path to save the soudfile to. This can then be allocRead 'd into a Score.</p>
<p class="p4"><br></p>
<p class="p5"><b><span class="Apple-tab-span">	</span>loadToBuffer (buf)</b></p>
<p class="p6"><b><span class="Apple-tab-span">	</span></b></p>
<p class="p5"><b><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></b>Load pc data to a buffer for real-time performance.<span class="Apple-converted-space"> </span></p>
<p class="p9"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span><b>buf </b>- A buffer to load to. If nil, one is allocated for you.</p>
<p class="p4"><br></p>
<p class="p5"><b><span class="Apple-tab-span">	</span>freeBuffer</b></p>
<p class="p6"><b><span class="Apple-tab-span">	</span></b></p>
<p class="p5"><b><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></b>liberates the buffer from SuperCollider tyranny.</p>
<p class="p4"><br></p>
<p class="p5"><b><span class="Apple-tab-span">	</span>getBinFreqs (bin)</b></p>
<p class="p6"><b><span class="Apple-tab-span">	</span></b></p>
<p class="p5"><b><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></b>Returns an array of freqs of nFrames length for bin.</p>
<p class="p8"><br></p>
<p class="p5"><b><span class="Apple-tab-span">	</span>getBinMags (bin)</b></p>
<p class="p6"><b><span class="Apple-tab-span">	</span></b></p>
<p class="p5"><b><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></b>Returns an array of mags of nFrames length for bin.</p>
<p class="p4"><br></p>
<p class="p5"><b><span class="Apple-tab-span">	</span>getFrameFreqs (frame)</b></p>
<p class="p6"><b><span class="Apple-tab-span">	</span></b></p>
<p class="p5"><b><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></b>Returns an array of freqs of nBins length for a given frame</p>
<p class="p6"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></p>
<p class="p5"><b><span class="Apple-tab-span">	</span>getFrameMags (frame)</b></p>
<p class="p6"><b><span class="Apple-tab-span">	</span></b></p>
<p class="p5"><b><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></b>Returns an array of mags of nBins length for a given frame</p>
<p class="p4"><br></p>
<p class="p5"><b><span class="Apple-tab-span">	</span>magScale</b></p>
<p class="p6"><b><span class="Apple-tab-span">	</span></b></p>
<p class="p5"><b><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></b>A (possibly vain) attempt to figure out an appropriate amplitude to scale the output of PVSynth by.<span class="Apple-converted-space"> </span></p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>Returns the reciprocal of the average of all mags times the number of bins.</p>
<p class="p6"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span></p>
<p class="p5"><span class="Apple-tab-span">	</span><span class="Apple-tab-span">	</span>(mags.flat.mean * nBins).reciprocal</p>
</body>
</html>
